package edu.kjxy.day02Synchronized.synNotExtends;

/**
 * 功能:
 * 作者:程序员欧阳子韩
 * 日期:2024/2/1 20:25
 */
public class Sub extends Main{
    @Override
    synchronized public void serviceMethod() {
        try {
            System.out.println(" int sub 下一步 sleep begin threadName= " +
                    Thread.currentThread().getName() + " time=" + System.currentTimeMillis());
            Thread.sleep(5000);
            System.out.println(" int sub 下一步 sleep end threadName= "
                    + Thread.currentThread().getName() + " time=" + System.currentTimeMillis());
            super.serviceMethod();
        }catch (InterruptedException e){
            e.printStackTrace();
        }
    }
}
